<!DOCTYPE html>
<html lang="en">

<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <!-- Meta, title, CSS, favicons, etc. -->
    <meta charset="utf-8">
    
    <meta name="viewport" content="width=device-width, initial-scale=1">

    <title>${_title}</title>

    <!-- Bootstrap core CSS -->

    <link href="${_css}/bootstrap.min.css" rel="stylesheet">

    <link href="${_font}/css/font-awesome.min.css" rel="stylesheet">
    <link href="${_css}/animate.min.css" rel="stylesheet">

    <!-- Custom styling plus plugins -->
    <link href="${_css}/custom.css" rel="stylesheet">
    <link href="${_css}/icheck/flat/green.css" rel="stylesheet">


    <script src="${_js}/jquery.min.js"></script>

    <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
    <!--[if lt IE 9]>
          <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
          <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
        <![endif]-->

</head>


<body style="background: #F7F7F7;">
<div class="">
    <div class="row">
        <div class="col-md-12 col-sm-12 col-xs-12">
            <div class="x_panel">
                <div class="x_title">
                    <h2>类目设置</h2>
                    <div class="clearfix"></div>
                </div>
                <div class="x_content">

                    <form class="form-horizontal form-label-left" novalidate>
                        <div class="item form-group">
                            <label class="control-label col-md-3 col-sm-3 col-xs-12" for="name">类目名称 <span class="required">*</span>
                            </label>
                            <div class="col-md-6 col-sm-6 col-xs-12">
                                <input id="name" class="form-control col-md-7 col-xs-12"
                                name="name" placeholder="输入类目名称" required="required" type="text">
                            </div>
                        </div>
                        <!-- TODO PID待做-->
                        <div class="item form-group">
                            <label class="control-label col-md-3 col-sm-3 col-xs-12" for="order">类目排序号 <span class="required">*</span>
                            </label>
                            <div class="col-md-6 col-sm-6 col-xs-12">
                                <input id="order" class="form-control col-md-7 col-xs-12"
                                name="order" placeholder="输入类目排序号" required="required" type="text"
                                onkeyup="value=value.replace(/[^\d]/g,'')" >
                            </div>
                        </div>
                        <div class="item form-group">
                            <label class="control-label col-md-3 col-sm-3 col-xs-12" for="order">类目类型<span class="required">*</span>
                            </label>
                            <div class="col-md-6 col-sm-6 col-xs-12">
                            	<checkboxlist id="cbk">
	                            	<input type="checkbox" id="cbox1" name="cbk" value="news"> 新闻
	                            	&nbsp;&nbsp;&nbsp;&nbsp;
	                            	<input type="checkbox" id="cbox2" name="cbk" value="notice"> 公告
                            	</checkboxlist>
                            </div>
                        </div>
                        
                        <div class="item form-group">
                            <label class="control-label col-md-3 col-sm-3 col-xs-12" for="desc">类目描述
                            </label>
                            <div class="col-md-6 col-sm-6 col-xs-12">
                                <textarea id="desc" required="required" name="desc" class="form-control col-md-7 col-xs-12"></textarea>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
	</div>
   	<div class="row">
	<div class="col-md-12 col-sm-12 col-xs-12">
	    <div class="ln_solid"></div>
	    <div class="form-group">
	        <div class="col-md-12 col-md-offset-5">
	            <button type="button" onclick="javascript:history.go(-1)" class="btn btn-primary">返回前一页</button>
	            <button id="send" type="button" class="btn btn-success">确认设置</button>
	            <button id="publishArticle" type="button" class="btn btn-primary">发布新闻</button>
	        </div>
	    </div>			
	</div>
	</div> 
</div>
    <script src="${_js}/bootstrap.min.js"></script>
    <!-- bootstrap progress js -->
	<script src="${_js}/progressbar/bootstrap-progressbar.min.js" type="text/javascript"></script>
	<script src="${_js}/nicescroll/jquery.nicescroll.min.js" type="text/javascript"></script>

    <!-- chart js -->
    <script src="${_js}/custom.js"></script>
    <!-- PNotify -->
	<script src="${_js}/notify/pnotify.core.js" type="text/javascript"></script>
	<script src="${_js}/notify/pnotify.buttons.js" type="text/javascript"></script>
	<script src="${_js}/notify/pnotify.nonblock.js" type="text/javascript" ></script>
	<script type="text/javascript">
		$(".btn-success").click(function(){
			var articleType = "";
			$('input[name="cbk"]:checked').each(function(){
				articleType = $(this).val();
			});
			var name = $.trim($("#name").val());
			var desc = $.trim($("#desc").val());
			var order = $.trim($("#order").val());
			var info=JSON.stringify({
				name:name,
				desc:desc,
				order:order,
				type:articleType
			});
			$.ajax({
	            type: 'POST',
	            dataType: 'JSON',
	            async:'false',
	            headers: {'Content-type': 'application/json;charset=UTF-8'},
	            url: '/admin/article/saveArticleType',
	            data:info,
	            success: function(result){
	              //console.log(result);
	       		  if(result.code==-1){
	            		new PNotify({
			            	title: '操作提示',
			            	text: '设置成功',
			            	delay: 3e3,
			            	type: 'success'
			        	});
	       		  }else{
	            		new PNotify({
			            	title: '操作提示',
			            	text: result.msg,
			            	delay: 3e3,
			            	type: 'error'
			        	});       		  	
	       		  }
	            }
		    })	
			
		});

		<!-- 发布文章-->
		$("#publishArticle").click(function(){
			window.location.href="/admin/article/settingArticle";
		});
    </script>
</body>

</html>